home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14354 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: HELP...HELP
  5. Date: Sat, 13 Apr 96 15:44:31 GMT
  6. Organization: none
  7. Message-ID: <829410271snz@genesis.demon.co.uk>
  8. References: <316EF6A1.41C6@ift.ulaval.ca>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <316EF6A1.41C6@ift.ulaval.ca>
  15.            baklouti@ift.ulaval.ca "Ferid Baklouti" writes:
  16.  
  17. >Hello everyone,
  18. >
  19. >imagine this command under a unix system :
  20. >
  21. >        program1 < file | program2 | program3 > file.results
  22. >
  23. >i want the "program2" to be able to detect the name of "file" given on
  24. >the standard input <stdin> to the program1.
  25.  
  26. Not possible. The best you could hope to do is perform a find like scan
  27. over the entire filesystem to see if you could find something that matches.
  28.  
  29. This is a pure Unix question and has nothing to do with the standard C
  30. language - ask in comp.unix.programmer.
  31.  
  32. >in the file stdio.h, I only find the things below which doesn't contain
  33. >the name of the file.
  34.  
  35. That's because it doesn't know the name of the file and indeed doesn't
  36. need to know it. The file could have no filename or multiple filenames
  37. (links). If you need a filename require it to be passed as a command line
  38. argument.
  39.  
  40. -- 
  41. -----------------------------------------
  42. Lawrence Kirby | fred@genesis.demon.co.uk
  43. Wilts, England | 70734.126@compuserve.com
  44. -----------------------------------------
  45.